package com.baiyang.server.service.base.impl;


import com.baiyang.server.service.impl.BaseServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.baiyang.server.dao.base.FilterWordDao;
import com.baiyang.server.model.base.FilterWord;
import com.baiyang.server.service.base.FilterWordService;

/**
 * 
 * @author XVX
 * BY: @Primary 注解帮助生命@Autowired优先注入的实列
 */
@Service	
public class FilterWordServiceImpl extends BaseServiceImpl<FilterWordDao, FilterWord> implements FilterWordService{

    @Autowired
    private FilterWordDao filterWordDao = null;

    @Override
    public boolean canInsert(String word) {
        FilterWord filterWord = new FilterWord();
        filterWord.setWord(word);
        filterWord = filterWordDao.selectOne(filterWord);
        if(filterWord != null){
            return false;
        }else {
            return true;
        }
    }
}
